package com.keba.lamp.complaint.enumeration;


import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.stream.Stream;

@Getter
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "案件状态-枚举")
public enum CaseStateEnum {

    /**
     * 暂存
     */
    SAVE("00","暂存"),
    /**
     * 完成
     */
    COMPLETE("10","完成"),
    ;


    @Schema(description = "字典key")
    private String code;
    @Schema(description = "描述")
    private String desc;



    public static CaseStateEnum getByCode(String code) {

        return Stream.of(CaseStateEnum.values())
                .filter(p -> p.getCode().equals(code))
                .findAny()
                .orElse(null);
    }

}
